package com.yisu.expressway.weather;

import com.yisu.expressway.R;

/**
 * Created by Administrator on 2016/12/24 0024.
 */

public class ResUtils {
    public static int getWeatherIcon(int code){
        int resId = 0;
        if(code <= 3){ //晴
            resId = R.drawable.ic_sunny;
        }else if(code <= 9){//阴
            resId = R.drawable.ic_cloudy;
        }else if(code == 11){//阵雨
            resId = R.drawable.ic_thunder_rain;
        }else if(code <= 20){//雨
            resId = R.drawable.ic_rainy;
        }else if(code <= 25){//雪
            resId = R.drawable.ic_snow;
        }else if(code <= 31){//雾
            resId = R.drawable.ic_floggy;
        }else if(code <= 36){//风
            resId = R.drawable.ic_wind;
        }else {
            resId = R.drawable.ic_sunny;
        }

        return resId;

    }

    public static int getWeatherBg(int code){
        int resId = 0;
        if(code <= 3){ //晴
            resId = R.drawable.ic_bg_sunny;
        }else if(code <= 9){//阴
            resId = R.drawable.ic_bg_cloudy;
        }else if(code == 11){//阵雨
            resId = R.drawable.ic_bg_thunder;
        }else if(code <= 20){//雨
            resId = R.drawable.ic_bg_rainy;
        }else if(code <= 25){//雪
            resId = R.drawable.ic_bg_snow;
        }else if(code <= 31){//雾
            resId = R.drawable.ic_bg_floggy;
        }else if(code <= 36){//风
            resId = R.drawable.ic_bg_wind;
        }else {
            resId = R.drawable.ic_bg_sunny;
        }
        return resId;

    }
}
